package com.xdtech.transportation.vo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.sql.Timestamp;

import com.xdtech.core.orm.utils.BeanUtils;
import com.xdtech.transportation.model.TranDriver;

import com.xdtech.web.freemark.item.GridColumn;

/**
 * 
 * @author max.zheng
 * @create 2015-03-17 14:04:31
 * @since 1.0
 * @see
 */
public class TranDriverItem implements Serializable{
	private static final long serialVersionUID = 1L;
	private Long id;
	@GridColumn(title="姓名",width=100)
	private String name;
	@GridColumn(title="驾驶员编号",width=100)
	private String driverNo;
	@GridColumn(title="身份证编号",width=100)
	private String idCard;
	@GridColumn(title="驾驶证编号",width=100)
	private String drivingNum;
	@GridColumn(title="驾驶证类型",width=100)
	private String drivingType;

	public void setId(Long id) {
		this.id = id;
	}
	public Long getId() {
		return id;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	public String getName() {
		return name;
	}
	
	public void setDriverNo(String driverNo) {
		this.driverNo = driverNo;
	}
	public String getDriverNo() {
		return driverNo;
	}
	
	public void setIdCard(String idCard) {
		this.idCard = idCard;
	}
	public String getIdCard() {
		return idCard;
	}
	
	public void setDrivingNum(String drivingNum) {
		this.drivingNum = drivingNum;
	}
	public String getDrivingNum() {
		return drivingNum;
	}
	
	public void setDrivingType(String drivingType) {
		this.drivingType = drivingType;
	}
	public String getDrivingType() {
		return drivingType;
	}
	
	/**
	 * 根据model构建vo
	 * 
	 * @author max
	 * @return
	 */
	public static TranDriverItem createItem(TranDriver tranDriver) {
		TranDriverItem tranDriverItem = new TranDriverItem();
		BeanUtils.copyProperties(tranDriverItem, tranDriver);
		//自定义属性设置填充
		return tranDriverItem;
	}
	/**
	 * 根据model集合创建vo集合
	 * 
	 * @author max
	 * @return
	 */
	public static List<TranDriverItem> createItems(List<TranDriver> tranDrivers) {
		List<TranDriverItem> tranDriverItems = new ArrayList<TranDriverItem>();
		for (TranDriver tranDriver : tranDrivers) {
			tranDriverItems.add(createItem(tranDriver));
		}
		return tranDriverItems;
	}
}
